
#include "Slist.h"

void test1(void)
{
	slistnode* plist=NULL ;
	slistpushback(&plist, 1);
	slistprint(plist);
	slistpushback(&plist, 2);
	slistprint(plist);
	slistpushback(&plist, 3);
	slistprint(plist);
	slistpushfront(&plist, 30);
	slistprint(plist);
	slistpushfront(&plist, 50);
	slistprint(plist);

}

void test2(void)
{
	slistnode* plist = NULL;
	slistpushback(&plist, 1);
	slistpushback(&plist, 2);
	slistpushback(&plist, 3);
	slistpushfront(&plist, 30);
	slistpushfront(&plist, 50);
	slistprint(plist);
	slistpopfront(&plist);
	slistprint(plist);
	slistnode* fin=slistfind(plist, 3);
	slistprint(fin);
	slistnode* pos = plist->next;
	pos = pos->next;
	slistinsertafter(pos, 60);
	slistinsertafter(plist, 160);
	slistprint(plist);
	slistdestroy(&plist);
	slistprint(plist);

}

void test3(void)
{
	slistnode* plist = NULL;
	slistpushback(&plist, 1);
	slistpushback(&plist, 2);
	slistpushback(&plist, 3);
	slistpushfront(&plist, 30);
	slistpushfront(&plist, 50);
	slistprint(plist);
	
	//slistpopback(&plist);
	//slistprint(plist);

	slistnode* pos = plist->next;
	pos = pos->next;
	slisteraseafter(pos);
	slistprint(plist);

}

int main()
{
	//test1();
	test2();
	//test3();

	return 0;
}